package com.hxs.learn.schedule.job;

import com.hxs.learn.schedule.service.TestService;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * Job demo
 *
 * @author HuXinsheng
 */
public class DemoJob implements Job {
    private Logger logger = LoggerFactory.getLogger(getClass());
    @Autowired
    TestService testService;

    @Override
    public void execute(JobExecutionContext context) {
        // TODO Auto-generated method stub
        testService.printName();
        logger.info("JobName: {}", context.getJobDetail().getKey().getName());
    }

}
